package com.example.flow.controller;

import javax.validation.Valid;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.example.flow.biz.FlowBiz;
import com.example.flow.request.CommonApproveRequest;
import com.example.flow.request.SubmitRequest;

/**
 * @author tangaq
 * @date 2020/11/25
 */
@RequestMapping("/flow/")
@RestController
public class FlowController {

    @Autowired
    private FlowBiz flowBiz;

    @RequestMapping("/submit")
    public String submit(@RequestBody @Valid SubmitRequest request) {
        return flowBiz.submit(request);
    }

    @RequestMapping("/approve")
    public void approve(@RequestBody @Valid CommonApproveRequest request) {
        flowBiz.commonApproval(request);
    }
}
